home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_torch_special.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  98 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_torch_special.cog
  4. #
  5. # Lights a torch and a couple of things around it
  6. #
  7. # [SXC] [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15. message     activated
  16. message     startup
  17.  
  18. thing       torch                //the thing you light
  19. thing       flame        nolink    //flame, hidden at startup
  20. thing        xtralight    nolink    //another ghost object to widen the flame effect
  21. thing        xtralight2    nolink    //yet another...
  22.  
  23. thing        player        local
  24.  
  25. sound        lightsound=gen_torchlitet_c.wav    local
  26. sound       burning=gen_torch_burnin_c.wav  local
  27.  
  28. vector      minlite        local
  29. vector      maxlite        local
  30.  
  31. surface        lightit                
  32.  
  33. int         locked=0    local
  34.             
  35. flex        reach=0        //0 for medium, 1 for high
  36. end
  37.  
  38. # ========================================================================================
  39.  
  40. code
  41.  
  42. startup:
  43.     minlite = VectorSet(0.87, 0.55, 0.06);
  44.     maxlite = VectorSet(0.89, 0.64, 0.30);    
  45.     SetThingFlags(flame, 0x10);
  46.  
  47.     ClearAdjoinFlags(lightit, 0x2);
  48.  
  49.     return;
  50.  
  51. # ........................................................................................
  52. activated:
  53. # ---> torch
  54.  
  55.     if (locked) return;
  56.     locked = 1;
  57.     
  58.     player = GetLocalPlayerThing();
  59.     
  60.     # only works with lighter or Marcus
  61.     if ((GetCurWeapon(player) != 13) && (InEditor() == 0)) return;
  62.  
  63.     SetActorFlags(player, 0x200000);
  64.     StopThing(player);
  65.  
  66.     # player reaches medium or high depending on Reach variable
  67.     PlayMode(player, (60 + reach), 0);
  68.     Sleep(0.5);
  69.  
  70.     # make flame visible, play fwoosh, light other stuff too
  71.     ClearThingFlags(flame, 0x10);
  72.     PlaySoundThing(lightsound, torch, 0.4, 3, 10, 0);
  73.     SetThingLight(torch, minlite, 0.3, 0.5);
  74.     SetThingLight(xtralight, VectorScale(minlite, 0.5), 0.3, 0.5);
  75.     SetThingLight(xtralight2, VectorScale(minlite, 0.5), 0.3, 0.5);
  76.  
  77.     Sleep(0.5);
  78.  
  79.     # start flicker and ongoing burning sound
  80.     ThingLightAnim(torch, minlite, 0.3,  maxlite, 0.3, 2);
  81.     PlaySoundThing(burning, torch, 1, 3, 10, 1);
  82.     
  83.     sleep(.25);
  84.     ClearActorFlags(player, 0x200000);
  85.  
  86.     return;
  87.  
  88. # ........................................................................................
  89.  
  90. end
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.